package com.neu.mapper;


import com.neu.entity.Params;
import com.neu.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {

    @Select("select * from user where username = #{username}")
    User selectByUserName(String username);


    void insert(User user);

    List<User> findBySearch(@Param("params") Params params);

    int updateById(User user);

    @Delete("delete from user where id = #{id}")
    void deleteById(Integer id);

    @Select("select * from user where id = #{id}")
    User selectById(Integer id);

    @Select("select * from user")
    List<User> selectAll(User user);

}
